//
//  YSProductDetailPriceWithSalesView.m
//  Yueshi
//
//  Created by Northwan on 15/7/22.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSProductDetailPriceWithSalesView.h"


@interface YSProductDetailPriceWithSalesView()
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *oldPriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *buyCountLabel;


@end


@implementation YSProductDetailPriceWithSalesView

+(instancetype)priceSalesView{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSProductDetailPriceWithSalesView" owner:nil options:nil]lastObject];
}

-(void)setResult:(YSProductDetailRes *)result{
    _result = result;
    [self.priceLabel setText:[NSString stringWithFormat:@"¥%.1f",result.prodNewPrice]];
    
    self.oldPriceLabel.hidden = YES;
    NSString *oldPrice = [NSString stringWithFormat:@"¥%.1f",result.prodOldPrice];
    [UIUtil addMiddleLineWithLabel:self.oldPriceLabel text:oldPrice];
    
    [self.buyCountLabel setText:[NSString stringWithFormat:@"已售%ld",result.prodBuyCount]];
}


@end
